import type { ComType, EnergyType, PagingParams } from './type'
import { PAGING } from '@/constant'

export const defaultFormData: any = {
  name: '',
}

export const formRules = {
  name: [
    {
      required: true,
      message: '名称不能为空！',
      trigger: 'change',
    },
  ],
}

export const defaultPagingParams: PagingParams = {
  ...PAGING.PARAMS,
  name: '',
  state: null as any,
  startTime: '',
  endTime: '',
}

export const comObj: Partial<Record<EnergyType, ComType>>
  = {
    electric: {
      type: 'electric',
      render: () =>
        componentLoadAsync(
          () =>
            import('./components/electricity-report.vue'),
        ),
    },
  }
